import request from '@/utils/request'

// 查询销售退货列表
export function listRejected(query) {
  return request({
    url: '/rejected/rejected/list',
    method: 'get',
    params: query
  })
}

// 查询销售退货详细
export function getRejected(srId) {
  return request({
    url: '/rejected/rejected/' + srId,
    method: 'get'
  })
}

// 新增销售退货
export function addRejected(data) {
  return request({
    url: '/rejected/rejected',
    method: 'post',
    data: data
  })
}

// 修改销售退货
export function updateRejected(data) {
  return request({
    url: '/rejected/rejected',
    method: 'put',
    data: data
  })
}

// 删除销售退货
export function delRejected(srId) {
  return request({
    url: '/rejected/rejected/' + srId,
    method: 'delete'
  })
}
// 获取编码
export function getCode(code) {
  return request({
    url: '/rejected/rejected/getcode?code=' + code,
    method: 'post'
  })
}
//查询进货订单所有商品
export function selectSaleRejectProduct(query) {
  return request({
    url: '/rejected/rejected/selectSaleRejectProduct',
    method: 'post',
    params: query
  })
}
//审核
export function checkbyId(map) {
  return request({
    url: '/rejected/rejected/check',
    method: 'post',
    data:map
  })
}
//撤销
export function revokebyId(srId) {
  return request({
    url: '/rejected/rejected/revoke?srId='+srId,
    method: 'post',
  })
}
//关闭单据
export function colseById(srId) {
  return request({
    url: '/rejected/rejected/colseById?srId='+srId,
    method: 'post',
  })
}
//查看进货订单详情
export function getInfo(srcode) {
  return request({
    url: '/rejected/rejected/fileInfo?srcode='+srcode,
    method: 'post',
  })
}
//根据进货单进货退货单累计退货数量
export function selectByCode(saleCode) {
  return request({
    url: '/rejected/rejected/selectByCode?saleCode='+saleCode,
    method: 'get',
  })
}
